package com.share.ai.alibaba.starter.tools;

import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class WeatherTool {

    //告诉ai 遇到什么问题 就触发这个方法的调用(自动提取好参数)
    @Tool(description = "获取城市的天气信息")
    public String getCityWeather(@ToolParam(description = "城市") String city) {
        log.info("----大模型调用了----city={}", city);
        return "今天是晴天";
    }
}
